{% extends 'base_backend.html' %}
{% load static %}
{% load my_filter %}

{% block header_tail %}
<link rel="stylesheet" href="{% static 'zhongbao/zhongbao_admin/css/style.css' %}">
<link rel="stylesheet" href="{% static 'zhongbao/zhongbao_admin/css/iconfont.css' %}">
<link rel="stylesheet" href="{% static 'plugins/datatables/dataTables.bootstrap.css' %}">
<link rel="stylesheet" href="{% static 'public/ComboSelect/css/combo.select.css' %}">
<link rel="stylesheet" href="{% static 'zhongbao/config/css/main.css' %}">
<link rel="stylesheet" href="{% static 'layui/css/layui.css' %}">
<link rel="stylesheet" href="{% static 'laydate/theme/default/laydate.css' %}">
<script src="{% static 'laydate/laydate.js' %}"></script>
<!-- bootstrap datepicker -->
<link rel="stylesheet" href="{% static 'public/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css' %}">
<!-- daterange picker -->
<link rel="stylesheet" href="{% static 'public/bootstrap-daterangepicker/daterangepicker.css' %}">

<script src="{% static 'plugins\jQuery\jquery-2.2.3.min.js' %}"></script>
<script src="{% static 'plugins/vue1/vue.js' %}"></script>
<script src="{% static 'layui/layui.js' %}"></script>
<!-- bootstrap datepicker -->
<script src="{% static 'public/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js' %}"></script>
<!-- date-range-picker -->
<script src="{% static 'public/moment/min/moment.min.js' %}"></script>
<script src="{% static 'public/bootstrap-daterangepicker/daterangepicker.js' %}"></script>

{% endblock header_tail %}

{% block section_content %}
<div>
    <div class="box-header with-border">
        <h3 class="box-title">报表导出</h3>
    </div>
    <div class="col-md-12">
        <div class="box box-primary">
            <div class="box-header">
                <h3 class="box-title">众包报表导出</h3>
            </div>
            <div class="box-body">
                <form role="form" method="post" action="{% url 'task:report_export_agent' %}">
                    {% csrf_token %}
                    <p style="clear: both"></p>
                    <div style="width: 95%; float: left;">
                        <div style="float: left;" class="input-group select-config-div">
                            <label for="id" class="control-label">录入时间：</label>
                            <p>
                                <input name="ctime" type="text" class="form-control pull-right" autocomplete="off" id="ctime_range">
                            </p>
                        </div>
                        <div style="float: left;" class="input-group select-config-div">
                            <label for="id" class="control-label">通过时间：</label>
                            <p>
                                <input name="finish_flag" type="text" class="form-control pull-right" autocomplete="off" id="finish_range">
                            </p>
                        </div>
                        <div style="float: left;" class="input-group select-config-div">
                            <label for="id" class="control-label">提交时间：</label>
                            <p>
                                <input name="submit_flag" type="text" class="form-control pull-right" autocomplete="off" id="submit_range">
                            </p>
                        </div>
                        <div style="float: left;" class="input-group select-config-div">
                            <label for="id" class="control-label">用户名：</label>
                            <p>
                                <input name="username" type="text" class="config-input">
                            </p>
                        </div>
                    </div>
                    <p style="clear: both"></p>
                    <div class="form-group">
                    </div>
                    <input type="submit" class="btn btn-primary" data-toggle="modal" data-target="#myModalLabel"
                           value="生成结算报表">
                    <a class="btn btn-success" href="{% url 'task:file_operation' 'agent_report' %}">下载结算报表</a>
                </form>
            </div>
        </div>
    </div>
</div>
<script>
    function changeColor(id, color) {
        //$(id).parent().parent().parenzhongbao_operationlogst().children().children().children().find("li[color='green']");
        $(id).parent().parent().addClass("active");
        $(id).children().css("color", color);
    }

    //$("#taskManager").addClass("active");
    console.log('{{ is_agent }}')
    if ('{{ is_agent }}' === '1') {
        changeColor("#report_export_agent", "#00FF7F");
    } else {
        changeColor("#report_export", "#00FF7F");
    }

    laydate.render({
        elem: '#ctime_range',
        range: true
    });
    laydate.render({
        elem: '#finish_range',
        range: true
    });
    laydate.render({
        elem: '#submit_range',
        range: true
    });
</script>
{% endblock section_content %}
